﻿
namespace N_dimenslArr
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using Tao.FreeGlut;
    using Tao.OpenGl;
    using Tao.Platform;

    public class PeerScene
    {
        private List<Packet> packets = new List<Packet>();
        private List<Node> nodes = new List<Node>();
        public List<Link> links = new List<Link>();

        public double Zoom { get; set; }

        public PeerScene()
        { 
        }

        public void AddNode(Node node)
        {
            Debug.Assert(node != null, "node != null");
            this.nodes.Add(node);
        }

        public void AddLink(Link link)
        {
            Debug.Assert(link != null, "link != null");
            this.links.Add(link);
        }

        public void AddPacket(Packet packet)
        {
            Debug.Assert(packet != null, "packet != null");
            this.packets.Add(packet);
        }

        public void Render()
        {
            foreach (Packet packet in this.packets)
            {
                packet.Render();
            }

            foreach (Node node in this.nodes)
            {
                node.Render();
            }
            
            foreach (Link link in this.links)
            {
                link.Render(this.Zoom);
            }
        }
    }
}
